import {
    lazy
} from "react";
// lazy  路由懒加载
import BasicLayout from '../layouts/BasicLayout'
import Error404 from '../layouts/Error404'
import Welcome from '../pages/welcome'
const routes = [{
        path: "/",
        name: "首页",
        component: BasicLayout,
        exact: true,
        routes: [{
            path: "/",
            component: Welcome,
        }]
    }, {
        component: Error404,
        name: "404",
        path: "/404",
    },
    {
        component: Welcome,
        name: "欢迎回来",
        path: "/welcome",
    },
    {
        component: lazy(() =>
            import ("../pages/test")),
        name: "测试",
        path: "/test",
    },
    {
        component: lazy(() =>
            import ("../pages/login")),
        name: "登录",
        path: "/login",
    },
    {
        path: "/shopManage",
        name: "门店管理",
        component: BasicLayout,
        icon: 'desktop', // 有icon表示为siderBar 侧边栏路由
        routes: [{
            component: lazy(() =>
                import ("../pages/shopManage/brandManage")),
            name: "品牌管理",
            icon: 'desktop',
            path: "/shopManage/brandManage",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/bossAccountList")),
            name: "老板账号列表",
            icon: 'desktop',
            path: "/shopManage/bossAccountList",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/shopList")),
            name: "门店列表",
            icon: 'desktop',
            path: "/shopManage/shopList",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/shopAuditList")),
            name: "门店审核列表",
            icon: 'desktop',
            path: "/shopManage/shopAuditList",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/partnerManage")),
            name: "合伙人管理",
            icon: 'desktop',
            path: "/shopManage/partnerManage",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/staffPositionManage")),
            name: "员工职位管理",
            icon: 'desktop',
            path: "/shopManage/staffPositionManage",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/employeeList")),
            name: "员工管理",
            icon: 'desktop',
            path: "/shopManage/employeeList",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/memberTypeManage")),
            name: "员工类型管理",
            icon: 'desktop',
            path: "/shopManage/memberTypeManage",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/memberManage")),
            name: "会员管理",
            icon: 'desktop',
            path: "/shopManage/memberManage",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/businessCategory")),
            name: "经营类目",
            icon: 'desktop',
            path: "/shopManage/businessCategory",
        }, {
            component: lazy(() =>
                import ("../pages/shopManage/labelManage")),
            name: "标签管理",
            icon: 'desktop',
            path: "/shopManage/labelManage",
        }]
    },
    {
        path: "/deviceManage",
        name: "POS机管理",
        component: BasicLayout,
        icon: 'desktop',
        routes: [{
            path: "/deviceManage/posList",
            name: "POS机列表",
            component: lazy(() =>
                import ("../pages/deviceManage/posList")),
            icon: 'desktop',
        }]
    }
];
export default routes